StripOSLib
==========

By

Tony Houghton
271 Upper Weston Lane
Woolston
Southampton
SO19 9HY

<mailto:riscos@realh.co.uk>
<URL:http://www.realh.co.uk>

Version 2.0 written on 4 November 2002.

This works on recent versions of OSLib supporting 26-bit and 32-bit versions,
but to run StripOSLib on RISC OS 5 you'll need 32-bit versions of CTrim and
Every, or to rewrite the Go script to use something else and/or not bother
with the trimming. The Go script may also need rewriting if you want to use
the version of OSLib with more than 77 files per directory.

What it does
------------
It strips OSLib down to make it easier to mix with other libraries and
slightly faster to compile.

In precise terms, it carries out these steps:

* Removal of all non-X forms of functions from the ALF
* Removal of above, and non-essential macros, from headers
* Copies all headers into a single image file for easy reference
* "Crunches" working copies of headers for faster compilation

To use it with other libraries you may have to do some fiddling about with
os_error and boolean types, but I'll leave that up to you.

Requirements
------------
* The LibFile and Find tools supplied with Acorn C must be installed in Library
  or similar
* An image filing system capable of >77 files per directory such as SparkFS or
  X-Files

If you don't have either of these, don't give up. Read the section on "Using
alternative tools" before continuing.

tidyexc and removex were built with StubsG so they'll work with any version
of the SharedCLibrary. CTrim and Every are old 26-bit only versions so you
may need to hunt down updates.

How to use it
-------------
I recommend you don't do this to your original copy of OSLib. The best idea
is to copy it into a RAM disc (it'll need to be at least about 4MB though)
and work on that.

Take the copy you want to alter, and click on its SetVars Obey file. Then use
your favourite image filing system to create an image file called 'h' in the
same directory. Then double-click the 'Go' file in this directory and wait
for it to finish. If using a RAM disc, don't forget to copy it all back to a
safe place! I call my permanent copy 'XOSLib'.

Using alternative tools
-----------------------
Find and LibFile can be replaced by the PD utilities agrep and MakeAlf
respectively. However, if using agrep you will have to rewrite and recompile
tidyexc so that it prints out the first column of each line, because agrep
doesn't output as much information as Find, which outputs:

"Filename", line <n>:Contents of matching line

You will also have to read the documentation for MakeAlf to find out its
syntax for deleting a set of AOFs (LibFile's -d switch) from an ALF, taking
the list of files from a further file (LibFile's -v switch).

If you don't have a suitable image filing system, you can delete/comment out
the Copy statements from the 'Go' file. You may also want to skip the
crunching.

Acknowledgements
----------------
CTrim and Every are from the DeskLib distribution, and I think they're both
written by Julian Smith.
